<?php
/**
 * +----------------------------------------------------------------------
 * | summer framework
 * +----------------------------------------------------------------------
 * | Copyright (c) 2020 https://github.com/suframe/think-admin All rights reserved.
 * +----------------------------------------------------------------------
 * | Author: summer <806115620@qq.com>  2020/4/21 13:55
 * +----------------------------------------------------------------------
 */

namespace app\mall\enum;


class OpUserEnum extends Base
{

    public const ADMIN = 'admin';
    public const USER = 'user';
    public const CLERK = 'clerk';

    public static function toZhArray(): array
    {
        return [
            self::ADMIN => '管理员',
            self::USER => '用户',
            self::CLERK => '店员',
        ];
    }

    public function isAdmin()
    {
       return $this->getValue() == static::ADMIN;
    }

    public function isClerk()
    {
       return $this->getValue() == static::CLERK;
    }

    public function isUser()
    {
       return $this->getValue() == static::USER;
    }

}